/*
 * @Author: WeijianXu weijian.xu@unidt.com
 * @Date: 2024-02-27 16:43:55
 * @LastEditors: WeijianXu weijian.xu@unidt.com
 * @LastEditTime: 2024-09-19 10:26:51
 * @FilePath: \demo\bmap-gl-test\animation.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/

var keyFrames = [
  {
    center: new BMapGL.Point(120.215268,30.253265),
    zoom: 20,
    tilt: 70,
    heading: 0,
    percentage: 0
  },
  {
    center: new BMapGL.Point(120.216081,30.253772),
    zoom: 21,
    tilt: 70,
    heading: -60,
    percentage: 0.1
  },
  {
    center: new BMapGL.Point(120.217074,30.253538),
    zoom: 21,
    tilt: 70,
    heading: -90,
    percentage: 0.25
  },
  {
    center: new BMapGL.Point(120.217608,30.252813),
    zoom: 21,
    tilt: 70,
    heading: -120,
    percentage: 0.35
  },
  {
    center: new BMapGL.Point(120.21759,30.251822),
    zoom: 21,
    tilt: 70,
    heading: -180,
    percentage: 0.5
  },
  {
    center: new BMapGL.Point(120.216624,30.25144),
    zoom: 21,
    tilt: 70,
    heading: -240,
    percentage: 0.65
  },
  {
    center: new BMapGL.Point(120.215569,30.251686),
    zoom: 21,
    tilt: 70,
    heading: -270,
    percentage: 0.75
  },
  {
    center: new BMapGL.Point(120.214931,30.252434),
    zoom: 21,
    tilt: 70,
    heading: -330,
    percentage: 0.9
  },
  {
    center: new BMapGL.Point(120.215268,30.253265),
    zoom: 20,
    tilt: 70,
    heading: -360,
    percentage: 1
  }
];

var animation = new BMapGL.ViewAnimation(keyFrames, {
  duration: 16000,
  delay: 3000,
  interation: 'INFINITE'
});
// 开始动画
function startAnimation() {
  map.setZoom(20);
  map.startViewAnimation(animation);
}
// 结束动画
function endAnimation() {
  map.cancelViewAnimation(animation);
}


/* TODO 轨迹动画 */
